﻿using Alipay.EasySDK.Factory;
using Alipay.EasySDK.Kernel;
using Alipay.EasySDK.Marketing.OpenLife.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles.Infrastructure;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NLog.Config;
using PddHelper;
using PddHelper.Api;
using PddHelper.Models;
using SqlSugar;
using SqlSugar.Extensions;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using WebApi.Controllers;
using WebApi.Model;
using WebApiExtend;
using static Alipay.EasySDK.Factory.Factory;
using static Org.BouncyCastle.Math.EC.ECCurve;

namespace WebApi.Controllers
{
    /// <summary>
    /// 充值相关接口
    /// </summary>
    [ApiController]
    [Route("ChongZhi/[Action]")]
    public class ChongZhiController : BaseController
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="httpContextAccessor"></param>
        public ChongZhiController(IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor)
        {
        }

        #region 获取用户信息

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ApiResult<dynamic> GetUserInfo()
        {            
            var ret = new ApiResult<dynamic>();
            var entity = DbContext<system_user>().GetById(this.UserID);
            ret.Success(new { entity.id, entity.login_name, entity.user_name });
            return ret;
        }
        #endregion 
    }
}

